Ext.define("App.controller.Setting", {
    extend: "Ext.app.Controller",
    requires: ["Ext.MessageBox"],
    config: {
        refs: {
            settingCard: "#settingCard",
            settingList: "#settingList",
            settingInfo: "#settingInfo"
        },
        
        control: {
            settingList: {
                itemtap: "onSettingListItemTap"
            }
        }
    },
    
    
    onSettingListItemTap: function(list, idx, el, record){
		var id = record.data.id;
		if(id < 4){
			Ext.Msg.alert('提示', Global.expectText);
			return;
		}else if(id == 4){
			return;
		}
        var newsDetailStore = Ext.getStore('NewsDetail');
        if (!this.settingInfo) {
            this.settingInfo = Ext.widget('settingInfo');
        }
        this.settingInfo.config.title = record.get('name');
        this.getSettingCard().push(this.settingInfo);
		newsDetailStore.setData(record.data.info);
        this.settingInfo.setStore(newsDetailStore);
    }
    
});
